package za.org.foobar.famon.reporter;

import za.org.foobar.famon.dto.CFailure;
import za.org.foobar.famon.dto.CLoggingEvent;

import java.util.List;

/**
 *
 */
public class FamonSynchronousWorkProcessor implements FamonWorkProcessor {

    private FamonReporterLogic logic;

    public void setFamonReporterLogic(FamonReporterLogic logic) {
        this.logic = logic;
    }

    public void sendFailure(CFailure failure, String threadName, List<CLoggingEvent> loggingEventList,
                            Throwable exception) {
        logic.populateFailure(failure, threadName, loggingEventList, exception);
        logic.sendFailure(failure);
    }
}
